program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  x1, y1, z1, x2, y2, z2, x3, y3, z3: integer;
  x4, y4, z4, z5, x5, y5: integer;
  a, b, c, d, d4, d5: integer;
  k: real;
  fin: textfile;
begin
  assignfile(fin, 'input.txt');
  reset(fin);
  readln(fin, x1, y1, z1);
  readln(fin, x2, y2, z2);
  readln(fin, x3, y3, z3);
  readln(fin, x4, y4, z4);
  readln(fin, x5, y5, z5);
  a:=(y1-y2)*(z2-z3)-(z1-z2)*(y2-y3);
  b:=-((x1-x2)*(z2-z3)-(x2-x3)*(z1-z2));
  c:=(x1-x2)*(y2-y3)-(x2-x3)*(y1-y2);
  d:=-(a*x1+b*y1+c*z1);
  d4:=a*x4+b*y4+c*z4;
  d5:=a*x5+b*y5+c*z5;
  if (d4<=d5) then
  begin
    k:=(d4+d)/sqrt(a*a+b*b+c*c);
    writeln(k:0:5)
  end else begin
    k:=(d5+d)/sqrt(a*a+b*b+c*c);
    writeln (k:0:5);
  end;
  closefile(fin);
  readln;
end.
